package com.attendance.chdingtask.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Data
@Entity
@Table(name="auth_info")
@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler"})
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
@EntityListeners(AuditingEntityListener.class)
public class AuthInfo implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "主键")
    private Long id;
    @ApiModelProperty(value = "钉钉组织id")
    private String  corpId;
    private String corpName;
    @ApiModelProperty(value = "应用编码")
    private String appCode;
    @ApiModelProperty(value = "应用名称")
    private String appName;
    private String accessToken;
    @ApiModelProperty(value = "过期时间")
    private Long expires;
    @ApiModelProperty(value = "钉钉应用key")
    private String appKey;
    @ApiModelProperty(value = "钉钉应用secret")
    private String appSecret;
    @ApiModelProperty(value = "应用aggentId")
    private String agentId;
    @Transient
    @ApiModelProperty(value = "钉钉授权码")
    private String code;
    @Transient
    @ApiModelProperty(value = "应用可见性")
    private String pub;
    @CreatedDate
    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @LastModifiedDate
    @Column(name = "modify_time")
    @ApiModelProperty(value = "修改时间")
    private Date modifyTime;
}
